//
//  TicketCodeVc.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/1/19.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "TicketCodeVc.h"
#import "QRCodeCreateTool.h"
#import "TicketRecordVc.h"

@interface TicketCodeVc ()
@property (weak, nonatomic) IBOutlet UIImageView *codeImg;
@property (weak, nonatomic) IBOutlet UILabel *codeLab;

@end

@implementation TicketCodeVc

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"签到";
    self.codeImg.image = [QRCodeCreateTool createQRCodeWithString:self.model.ticketNo width:ScreenW-120];
    self.codeLab.text = [NSString stringWithFormat:@"签到码%@",self.model.ticketNo];
    [self setNavi];
}

- (void)setNavi
{
    UIButton *rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 60, 30)];
    [rightBtn setTitle:@"使用记录" forState:UIControlStateNormal];
    [rightBtn setTitleColor:RGBColorOne(100) forState:UIControlStateNormal];
    rightBtn.titleLabel.font = Font(15);
    [rightBtn addTarget:self action:@selector(rightClick) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn];
}
- (void)rightClick
{
    TicketRecordVc *vc = [[TicketRecordVc alloc]init];
    vc.model = self.model;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
